import tpl from './index.tpl'
import './index.scss'

import { tplReplace } from '../../utils/index'

import list from './list'
import indicator from './indicator'

export default ({swipers, courses})=>{
    console.log(swipers, courses)
    const listComp = list(swipers)    

    const indicatorComp = indicator( swipers )

    return {
        name: 'carousel',
        tpl(){          

            return tplReplace(tpl,{
                listWidth: (swipers.length) *1200 ,
                list: listComp.tpl(),
                indicator: indicatorComp.tpl()
            })
        }
    }
}